
<?php $__env->startSection('content'); ?>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
    <div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                <a href="">演示</a>
                <a>
                    <cite>导航元素</cite></a>
            </span>
        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
            <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
        </a>
    </div>
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body ">
                        <form class="layui-form layui-col-space5" method="post" action="<?php echo e(route('add')); ?>">
                            <?php echo e(csrf_field()); ?>

                            <div class="layui-input-inline layui-show-xs-block">
                                <input class="layui-input" placeholder="分类名称" name="name">
                                <input class="layui-input" placeholder="父级ID(默认为0)" name="parent_id">
                            </div>
                            <div class="layui-input-inline layui-show-xs-block">
                                <input type="submit" class="layui-btn"  lay-submit="" lay-filter="sreach">
                            </div>
                        </form>
                    </div>
                    <div class="layui-card-body ">
                        <table class="layui-table layui-form">
                            <thead>
                            <tr>
                                <th width="70">ID</th>
                                <th>分类名称</th>
                                <th width="50">父级ID</th>
                                <th width="250">操作</th>
                            </thead>
                            <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tbody class="x-cate">
                            <tr cate-id='1' fid='0' >
                                <td>
                                    <?php echo e($v->id); ?>

                                </td>

                                <td>
                                    <?php echo e($v->name); ?>

                                </td>

                                <td>
                                    <?php echo e($v->parent_id); ?>

                                </td>

                                <td class="td-manage">
                                    <button class="layui-btn layui-btn layui-btn-xs"  onclick="xadmin.open('编辑','<?php echo e(route('admin_edit',['id'=>$v->id])); ?>')" ><i class="layui-icon">&#xe642;</i>编辑1</button>
                                    <form action="<?php echo e(route('del',['id'=>$v->id])); ?>" method="post">
                                        <?php echo e(csrf_field()); ?>

                                        <?php echo e(method_field('DELETE')); ?>

                                        <input type="submit" value="删除" class="layui-btn-danger layui-btn layui-btn-xs">
                                    </form>
                                </td>
                            </tr>
                            </tbody>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </table>
                        <?php echo e($data->links()); ?>

                    </div>
                    </div>
                </div>
            </div>
        </div>
    <?php $__env->stopSection(); ?>

<?php echo $__env->make('master.index', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>